<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>21</title>
    <script src="vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" v-model="text" name="" id="">
        <h2>{{text | filterA}}</h2>
    </div>
    <script>

        Vue.filter('filterA',function(value){
            return value.split(' ').join('');
        });

        new Vue({
            el:'#app',
            data: {
                text:''
            }
        });
    </script>
</body>

</html>